import cv2
import location

scene_list = [
    'xgfl.png',
    'daodi.png',
    'jg.png',
    'storeindex2.png',
]

# 获取场景
def getscene(cut_main_gray):
    for scene in scene_list:
        scene_gray = cv2.cvtColor(cv2.imread('./scene/' + scene), cv2.COLOR_BGR2GRAY)
        locations = location.getlocations(cut_main_gray, scene_gray)

        if len(locations) > 0:
            if 'storeindex2' in scene:
                return "商店首页"
            elif 'jg' in scene:
                return "全部商品"
            elif 'xgfl' in scene:
                return "下个分类"
            elif 'daodi' in scene:
                return "到底了"
    return "未知"